package com.job.bytedance;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @ClassName: ByteDance2_2
 * @Description:
 * @Author: 12071
 * @Date: 2022/4/24 14:56
 */
public class ByteDance1 {
//    static List<String> res = new ArrayList<>();
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuffer str = new StringBuffer(sc.nextLine());
        backTrace(str,0,0);
    }

    public static void backTrace(StringBuffer str, int startIndex, int pointCount){
//        System.out.print(str.toString()+"\t|"+startIndex+"|\t");
        if(pointCount==3){
            if(isValid(str.toString(), startIndex, str.length()-1)){// 判断第四个位置
                System.out.println(str.toString());
            }
            return;
        }
        for (int i = startIndex; i < str.length(); i++) {
            if(isValid(str.toString(),startIndex,i)){
                str = str.insert(i+1,".");
                pointCount++;
                backTrace(str,i+2, pointCount);
                str = str.deleteCharAt(i+1);
                pointCount--;
            }else {
                break;
            }
        }
    }

    public static boolean isValid(String str, int start, int end){
        if(start > end) return false;
        if(str.charAt(start)=='0' && start!=end) return false; //含先导0
        int num = 0;
        for (int i = start; i <=end ; i++) {
            char ch = str.charAt(i);
            if(ch>'9' || ch <'0') return false;
            num = num*10+ch-'0';
            if(num>255) return false;
        }
        return true;
    }
}
